import qua from '@api/config/quality-check'
/**
 *  质检模板查询
 * @param {*} param0
 * @param {*} data
 */
export const queryQualityCheckTemplate = ({ commit, state, rootState }, data) => {
  return qua.queryQualityCheckTemplate(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}

/**
 * 停用质检模板
 * @param {*} param0
 * @param {*} data
 */
export const changeQualityCheckTemplateStatus = ({ commit, state, rootState }, data) => {
  return qua.changeQualityCheckTemplateStatus(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}

export const queryQualityCheckCycle = ({ commit, state, rootState }, data) => {
  return qua.queryQualityCheckCycle(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}

/**
 * 质检周期停用启用
 */
export const changeQualityCheckCycleStatus = ({ commit, state, rootState }, data) => {
  return qua.changeQualityCheckCycleStatus(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
/**
 * 添加质检周期
 */
export const saveQualityCheckCycle = ({ commit, state, rootState }, data) => {
  return qua.saveQualityCheckCycle(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
/**
 * 查询人工绩效数列表
 */

export const queryPerformanceRelatedNum = ({ commit, state, rootState }, data) => {
  return qua.queryPerformanceRelatedNum(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
export const stopOrUsePerformanceRelatedNum = ({ commit, state, rootState }, data) => {
  return qua.stopOrUsePerformanceRelatedNum(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
/**
 * 添加人工绩效数列表
 */
export const addPerformanceRelatedNum = ({ commit, state, rootState }, data) => {
  return qua.addPerformanceRelatedNum(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
/**
 * 修改人工绩效数列表
 */
export const updatePerformanceRelatedNum = ({ commit, state, rootState }, data) => {
  return qua.updatePerformanceRelatedNum(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}

/**
 * 保存质检模板
 * @param {*} param0
 * @param {*} data
 */
export const saveQualityCheckTemplateTwo = ({ commit, state, rootState }, data) => {
  return qua.saveQualityCheckTemplateTwo(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}

/**
 * 保存打分模板
 * @param {*} param0
 * @param {*} data
 */
export const saveQualityCheckTemplate = ({ commit, state, rootState }, data) => {
  return qua.saveQualityCheckTemplate(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
// queryQualityCheckTemplate
// saveQualityCheckTemplate
// saveQualityCheckTemplateTwo
// changeQualityCheckTemplateStatus
// queryQualityCheckCycle
// saveQualityCheckCycle
// changeQualityCheckCycleStatus
// queryPerformanceRelatedNum
// addPerformanceRelatedNum
// updatePerformanceRelatedNum
// stopOrUsePerformanceRelatedNum
export const queryQualityCheckMonitorTypeConfig = ({ commit, state, rootState }, data) => {
  return qua.queryQualityCheckMonitorType(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
export const addQualityCheckMonitorType = ({ commit, state, rootState }, data) => {
  return qua.addQualityCheckMonitorType(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}

export const updateQualityCheckMointorTypeStatus = ({ commit, state, rootState }, data) => {
  return qua.updateQualityCheckMointorTypeStatus(data)
    .then(response => {
      return response
    })
    .catch(err => {
      console.error(err)
    })
}
